package com.crape.common.constants;

import java.io.IOException;
import java.util.Properties;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

/**
 * Properties管理类：properties为propertyConfigurer的locations
 * @author chenkaibj7051 2012-4-18 上午10:45:33
 */
public class CrapePropertyConfigurer extends PropertyPlaceholderConfigurer {

	private static Properties properties = new Properties();

	public static String getProperty(String key) {
		return properties.getProperty(key);
	}
	
	public static String getProperty(String key,String defaultValue) {
		return properties.getProperty(key, defaultValue);
	}
	
	public static Properties getProperties() {
		return properties;
	}

	protected void loadProperties(Properties props) throws IOException {
		super.loadProperties(props);
		properties = props;
	}
}
